<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>倒计时</title>
</head>
<body>
    距离2020年10月1日还差:<br>
        <input type="text" id="d">天
</body>
        <script>
            let targetDate=new Date(2020,9,1) ;
            let date=new Date();
            let dateM=date.getTime();
            let targetDateM=targetDate.getTime();
            let time=targetDateM-dateM;
            let day=time/1000/60/60/24;
            let day=Math.floor(day);
            alert(day);
        </script>
</html>